// consider the extended components is placed in the same directory with internal components
define(['require', './PageView'], function(require, PageView) {
  return PageView.extend({
    type: 'PageView',
    events: {
      'click .checkclick': "onCheckClick"
    },
    initialize: function(options){
      console.log('++++++++++++++++++++++');
    },
    ListViewRowSelect:function(options){
      // alert("sss");
      var listRow = options.sender;
      var e = options.arguments.event.target;
      var click = e.getAttribute("click");
      if(click=="delete"){
        listRow.model.destroy();
        library.Toast("删除成功");
      }else if(click=='add'){
        var number = listRow.model.get("number") +1;
        listRow.model.set({"number":number});
      }else if (click == 'reduces') {
        var number = listRow.model.get("number") -1;
        if(number < 0) number = 0;
        listRow.model.set({"number":number});
      }
    },
    onCheckClick:function(e){
      console.log("----------");
      window.location.href = 'zEPP8RLEp.html';
    }

  });
})
